/**
 * Created by mac1 on 2017/11/13.
 */
var pg = require('pg');
var conString = "tcp://myuser:mypassword@localhost:5432/mydatabase";
var client = new pg.Client(conString);
client.connect();

client.query(
  'INSERT INTO users ' +
    "(name) VALUES ('Mike')"
);
client.query(
  "INSERT INTO users " +
    "(name, age) VALUES ($1,  $2)",
  ['Mike', 39]
);